import sys
from functools import partial
import binascii

if len(sys.argv) < 2:
    print("[*] Usage: " + sys.argv[0] + " [Data file] [Array name]")
    
    sys.exit(0)

sys.stdout.write("uint8_t " + sys.argv[2] + "[]=\n    \"")

y=0

with open(sys.argv[1], 'rb') as file:
    for byte in iter(partial(file.read, 1), b''):
        if y % 16 == 0 and y != 0:
            sys.stdout.write("\"\n    \"")
            
        sys.stdout.write ("\\x" + binascii.hexlify(byte).decode("ascii"))
        y += 1
    
sys.stdout.write("\";\n")
